const seq = require('../db_connect'),
      { STRING, INT, TEXT } = require('../../configs/db_type');

const Author = seq.define('author', {
  aid: {
  	comment: 'author ID',
  	type: STRING,
  	allowNull: false,
  	unique: true
  },

  name: {
  	comment: 'author name',
  	type: STRING,
  	allowNull: false
  },
  authorPosition: {
    comment: '作者的职业',
    type: STRING,
    // allowNull: 
  },
  imgUrl: {
  	comment: 'author image url',
  	type: STRING,
  	allowNull: false
  },
  desStatistics: {
    comment: '对作者的统计介绍',
    type: STRING
  },
  desDetail: {
  	comment: '作者详细介绍',
  	type: TEXT,
  	allowNull: false
  },
  imgKey: {
    comment: 'qiniu image name',
    type: STRING,
    allowNull: false
  },
  isStar: {
    comment: 'is the author a star author?',
    type: INT,
    defaultValue: 0,
    allowNull: false
  },
  status: {
    comment: 'author status',
    type: INT,
    defaultValue: 1,
    allowNull: false
  }
});

module.exports = Author;










